package com.wnzt.baszh.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.wnzt.baszh.dao.IUserDao;
/**
 * 系统设置接口实现类
 * @author dqw
 * @date 2017-3-13
 */
@Repository
public class UserDaoImpl implements IUserDao{

	@Autowired
	private JdbcTemplate jdbcTemplate;
	
	@Override
	public List<Map<String, Object>> getMenu(String fgroupcode) {
		String sql = "select t.fname as text ,t.fimage as iconCls,t.fviewid as attributes , t.fcode ,t.ffather, t.fhavechildren, t.fhavefather from TMENU t where t.fcode in "
				+ "(select  e.fmenucode  from TSYSUSER a "
				+ "LEFT JOIN TGROUP b on a.fgroupcode = b.fcode "
				+ "LEFT JOIN TGROUPRIGHT c on b.fcode = c.fgroupcode "
				+ "LEFT JOIN TRIGHT d on c.frightcode = d.fcode "
				+ "LEFT JOIN TRIGHTMENU e on d.fcode = e.frightcode "
				+ "where a.fgroupcode = '"+fgroupcode+"' )  order by t.FFATHER,t.fpx"; //and t.fsysflag = '3'
		List list = this.jdbcTemplate.queryForList(sql);
		return list;
	}

}
